package com.chuangshu.chuangshuteam.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 团队成员实体类
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("team_members")
public class TeamMember implements Serializable {
    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 用户ID
     */
    private Long userId;

    /**
     * 团队ID
     */
    private Long teamId;

    /**
     * 角色ID
     */
    private Long roleId;

    /**
     * 专业方向
     */
    private String direction;

    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createdAt;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updatedAt;

    /**
     * 关联的用户信息（非数据库字段）
     */
    @TableField(exist = false)
    private Users user;

    /**
     * 关联的角色信息（非数据库字段）
     */
    @TableField(exist = false)
    private Role role;
}
